package dao.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * PurchaseCommodityInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "purchase_commodity_info", catalog = "onlinemall")
public class PurchaseCommodityInfo implements java.io.Serializable {

	// Fields

	private Integer purchaseCommodityId;
	private Color color;
	private Size size;
	private PurchaseInfo purchaseInfo;
	private Integer retailPurchases;

	// Constructors

	/** default constructor */
	public PurchaseCommodityInfo() {
	}

	/** full constructor */
	public PurchaseCommodityInfo(Integer purchaseCommodityId, Color color,
			Size size, PurchaseInfo purchaseInfo, Integer retailPurchases) {
		this.purchaseCommodityId = purchaseCommodityId;
		this.color = color;
		this.size = size;
		this.purchaseInfo = purchaseInfo;
		this.retailPurchases = retailPurchases;
	}

	// Property accessors
	@Id
	@Column(name = "purchase_commodity_id", unique = true, nullable = false)
	public Integer getPurchaseCommodityId() {
		return this.purchaseCommodityId;
	}

	public void setPurchaseCommodityId(Integer purchaseCommodityId) {
		this.purchaseCommodityId = purchaseCommodityId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "color_id", nullable = false)
	public Color getColor() {
		return this.color;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "size_id", nullable = false)
	public Size getSize() {
		return this.size;
	}

	public void setSize(Size size) {
		this.size = size;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "purchase_id", nullable = false)
	public PurchaseInfo getPurchaseInfo() {
		return this.purchaseInfo;
	}

	public void setPurchaseInfo(PurchaseInfo purchaseInfo) {
		this.purchaseInfo = purchaseInfo;
	}

	@Column(name = "retail_purchases", nullable = false)
	public Integer getRetailPurchases() {
		return this.retailPurchases;
	}

	public void setRetailPurchases(Integer retailPurchases) {
		this.retailPurchases = retailPurchases;
	}

}